package com.assertionerror.loccounter.engine;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;

/**
 * @author <a href="mailto:petrus@codewave.co.za">Petrus Pelser</a>
 */
public class LineCounter {

    public Integer getLineCount(File file) throws IOException {
        Integer count = 0;

        FileReader reader = new FileReader(file);
        BufferedReader readerBuff = new BufferedReader(reader);
        while (readerBuff.readLine() != null) {
            count++;
        }
        readerBuff.close();

        return count;
    }
}
